import yaml

def readYaml(file, key_word):
    with open(file, encoding='utf-8') as f:
        test_data = yaml.safe_load(f)
        case_data = []
        for i in test_data:
            if i.get("key_word") == key_word:
                case_data.append((i.get('title'), i))
        return case_data

# case_data = readYaml(r'..\caseData\create_org.yaml', "create_org")
# print(case_data)